import request from '@/utils/request.js'

export const adminApi = {
	list(adminQuery) {
		return request.get('/admin/list', {params: adminQuery})
	},
	deleteById(id) {
		return request.delete( `/admin/deleteById/${id}`)   //反引号，直接写参数。否则需要字符串拼接
	},
	deleteAll(ids) {
		return request.delete( `/admin/deleteAll/${ids}`)
	},
	add(admin) {
		//admin以JSON形式传递到后台
		return request.post('/admin/add', admin)
	},
	selectById(id) {
		return request.get(`/admin/selectById/${id}`)
	},
	update(admin) {
		return request.put('/admin/update', admin)
	},
	login(admin) {
		//admin以JSON形式传递到后台
		return request.post('/admin/login', admin)
	},
	adminInfo(){
		return request.get('/admin/adminInfo')
	},
	updateStatus(id,status){
		return request.put(`/admin/updateStatus/${id}/${status}`)
	},
	resetPassword(adminPassword) {
		return request.put('/admin/resetPassword', adminPassword)
	}
}
